import java.util.Arrays;
import java.util.Comparator;
import java.util.Stack;

public class Leetcode646 {
    public int findLongestChain(int[][] pairs) {
        Arrays.sort(pairs, (a, b) -> {
            if (a[0] == b[0]) {
                return a[1] - b[1];
            }

            return a[0] - b[0];
        });

        return 0;
    }
}
